#pragma once

#ifndef LHJ_CORE_SERVICES_NET_SERVICE_H__
#define LHJ_CORE_SERVICES_NET_SERVICE_H__

#include "service.h"
#include <string>
#include <publisher.h>

namespace cores
{
    namespace services
    {
        namespace v1
        {
            using namespace std;
            using namespace cores::topics;
            class NetService : public BaseService,
                               public Publisher
            {
            public:
                NetService(const string &serviceName);
                virtual ~NetService();

                virtual void init() override;
                virtual void start() override;
                virtual void stop() override;

            protected:
                virtual void run();
                virtual bool checkNetwork();
                virtual bool connectNetwork();
                virtual void doWork();

            private:
                bool _netIsConnected{false};
            };
        }
    }
}

#endif